/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package MessageHandler;

import org.openymsg.network.Session;

/**
 *
 * @author Mr Bao
 */
public class SendTextMessageHandler implements IMessageHandler {

    public Object Process(String message, Session session) {
        try {
            String[] userInfo = message.split(",");
            String to = userInfo[0].substring(userInfo[0].indexOf(":") + 1).trim();
            String msg = userInfo[1].trim();
            session.sendMessage(to, msg);
            return true;
        } catch (Exception e) {
            return false;
        }
    }
}
